import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import updateLocale from 'dayjs/plugin/updateLocale';
import { views_factory } from './Factory';
import { Paths } from './paths';
import './styles/common.module.scss';
import "@/api/interceptors"
import CopyGuard from './utils/CopyGuard';

for (const k in Paths.All) {
  const p: Paths.All = (Paths.All as any)[k]
  const c = Paths.Routes[p]
  if (!c) continue;
  views_factory.register(p, c)
}


dayjs.extend(updateLocale)
dayjs.updateLocale('zh-cn', { weekStart: 0 });

document.body.addEventListener('keydown', (e) => {
  switch (e.key.toLowerCase()) {
    case 'f5': {
      window.location.href = window.location.href;
      break;
    }
  }
})
CopyGuard.running = __ENV__ === 'release'

